package com.pkk.penguin.frame.know.java.Javacoreknowledge.lock.base;

import com.pkk.penguin.frame.know.java.Javacoreknowledge.lock.LockVo;

/**
 * @description: 线程
 * @author: peikunkun
 * @create: 2020-01-13 17:35
 **/
public class NoLockThread extends Thread {

  private LockVo lockVo;


  public NoLockThread(LockVo lockVo) {
    this.lockVo = lockVo;
  }

  /**
   * If this thread was constructed using a separate
   * <code>Runnable</code> run object, then that
   * <code>Runnable</code> object's <code>run</code> method is called;
   * otherwise, this method does nothing and returns.
   * <p>
   * Subclasses of <code>Thread</code> should override this method.
   *
   * @see #start()
   * @see #stop()
   */
  @Override
  public void run() {
    while (true) {
      try {
        Thread.sleep(1000L);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      System.out.println(Thread.currentThread().getName() + " is hold the lock");
    }
  }
}
